package cn.xz.gobang.util

import cn.xz.gobang.R
import cn.xz.gobang.base.BaseApplication
import cn.xz.gobang.bean.UserDW
import okhttp3.*
import okhttp3.MediaType.Companion.toMediaTypeOrNull
import java.io.File
import java.io.IOException


/**
 * 获取服务端我的数据
 * */
object GetMyDataUtil {


    //根据积分获取等级
    fun getNum(num: Int): UserDW {
        var myDW = ""
        var mD = AppHelper.getDrawable(R.mipmap.icon_jb)
        var mColor = "#000000"
        if (num < 20){
            myDW = "段位-赤"
            mD = AppHelper.getDrawable(R.mipmap.icon_vip0)
            mColor = "#FF0000"
        }else if (num < 40){
            myDW = "段位-橙"
            mD = AppHelper.getDrawable(R.mipmap.icon_vip1)
            mColor = "#FF7F00"
        }else if (num < 60){
            myDW = "段位-黄"
            mD = AppHelper.getDrawable(R.mipmap.icon_vip2)
            mColor = "#FFFF00"
        }else if (num < 80){
            myDW = "段位-绿"
            mD = AppHelper.getDrawable(R.mipmap.icon_vip3)
            mColor = "#00FF00"
        }else if (num < 100){
            myDW = "段位-青"
            mD = AppHelper.getDrawable(R.mipmap.icon_vip4)
            mColor = "#00FFFF"
        }else if (num < 120){
            myDW = "段位-蓝"
            mD = AppHelper.getDrawable(R.mipmap.icon_vip5)
            mColor = "#0000FF"
        }else {
            myDW = "段位-紫"
            mD = AppHelper.getDrawable(R.mipmap.icon_vip6)
            mColor = "#8B00FF"
        }

        return UserDW(myDW,mD,mColor)
    }

}